<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://www.netvibes.com/ns/">
	<head>
		<title>Google Documents &amp; Spreadsheets</title>
		<link rel="icon" href="http://docs.google.com/images/favicon.ico" type="image/x-icon" />

    		<meta name="author" content="Matt Johnson" />
    		<meta name="description" content="A Google Documents &amp; Spreadsheets Netvibes UWA Widget." />
    		<meta name="apiVersion" content="1.0" />
    		<meta name="inline" content="false" />
		<meta name="debugMode" content="false" />

    		<link rel="stylesheet" type="text/css" href="http://www.netvibes.com/themes/uwa/style.css" />
		<script type="text/javascript" src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>

		<widget:preferences>
			<preference name="numDocuments" type="range" label="Number of Documents" min="1" max="9" step="1" defaultValue="5" />
			<preference name="showLastEdit" type="boolean" label="Show Last Edit" defaultValue="true" />
			<preference name="height" type="range" label="Widget Documents" min="100" max="500" step="10" defaultValue="240" />
			<preference name="padding" type="boolean" label="Remove Widget Padding" defaultValue="false" />
		</widget:preferences>

    		<style type="text/css">
     		/* your CSS rules */
    		</style>

    		<script type="text/javascript">
			var GoogleDocs = {}

			GoogleDocs.load = function() {
				var myNumDocuments = widget.getValue('numDocuments');
				var myShowLastEdit = widget.getValue('showLastEdit');
				var myHeight = widget.getValue('height');
				var myPadding = widget.getValue('padding');

				if (myShowLastEdit == 'true') myShowLastEdit = 1;
				else myShowLastEdit = 0;

				var myURL = "http://docs.google.com/API/IGoogle?up_numDocuments=" + myNumDocuments + "&up_showLastEdit=" + myShowLastEdit;

				if (myPadding == 'true') widget.body.style.padding = "0";
				contentHTML = "<iframe src=\""+myURL+"\" style=\"width:100%;border-width:0;\" frameborder=\"0\" height=\""+myHeight+"px\"></iframe>";
	
				widget.setBody(contentHTML); 
			}

			widget.onLoad = function() {
				GoogleDocs.load();
			}

			widget.onRefresh = function() {
				GoogleDocs.load();
			}

			widget.onResize = function() {
				//GoogleDocs.load();
			}
		</script>
	</head>

	<body>
		Loading...
	</body>
</html>
